#!/usr/bin/env python3
# -*- coding: utf-8 -*-

#请编写一个decorator，能在函数调用的前后打印出'begin call'和'end call'的日志

import functools
import time

def log(func):
    @functools.wraps(func)
    def wrapper(*args, **kw):
        print('begin call %s():' % func.__name__)
        result = func(*args, **kw)
        print('end call %s():' % func.__name__)
        return result
    return wrapper;

@log
def now():
    print('now,time is '+time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())))

now()